<!DOCTYPE html>
<html>
<head>
     <meta charset="UTF-8" />
  <title>查找元素</title>
  <style>
    body { font-family: Arial, sans-serif; padding: 10px; }
    /* input { width: 200px; }
    button { margin-top: 10px; } */
    /* 开关样式 */
    .switch {
      position: relative;
      display: inline-block;
      width: 40px;
      height: 20px;
    }

    /* 隐藏原始checkbox */
    .switch input {
      opacity: 0;
      width: 0;
      height: 0;
    }

    /* 自定义滑块 */
    .slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #ccc;
      transition: 0.4s;
      border-radius: 24px;
    }

    /* 小圆点 */
    .slider::before {
        position: absolute;
        content: "";
        height: 14px;
        width: 14px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.4s;
        border-radius: 50%;
    }

    /* 选中状态 */
    .switch input:checked + .slider {
      background-color: #4CAF50;
    }

    .switch input:checked + .slider::before {
      transform: translateX(18px);
    }
    .container{
      display: flex;
      justify-content: flex-start;
      align-items: center;
    }
    .title{
      font-size: 12px;
      font-weight: bold;
      margin-right: 10px;
      cursor: pointer;
    }
    .title:hover{
      color: #4CAF50;
    }
  </style>
</head>
<body>
<div class="container" id="insertContainer">
  <div class="title">Agoda</div>
  <label class="switch">
    <input type="checkbox" id="toggleInsert" />
    <span class="slider"></span>
  </label>
</div>  
  <script src="popup.js"></script>
  <!-- <script>
  document.getElementById('insertContainer').addEventListener('click', function(e) {
    // 排除直接点击 checkbox 或 label 的情况，避免重复触发
    if (!e.target.closest('label')) {
      const checkbox = document.getElementById('toggleInsert');
      checkbox.checked = !checkbox.checked;
    }
  });
</script> -->
</body>
</html>
